home *** CD-ROM | disk | FTP | other *** search
/ Network Support Library / RoseWare - Network Support Library.iso / drdos / dr6up2.exe / OPEN_UP.EXE / UPDATE.BAT < prev    next >
DOS Batch File  |  1992-04-07  |  7KB  |  285 lines

  1. @echo off
  2. if not "%OS%" == "DRDOS" goto error4
  3. if not "%VER%" == "6.0" goto error4
  4.  
  5. echo UPDATE R3.01  DR DOS File Update Utility
  6. echo Copyright (c) 1990,1991 Digital Research Inc. All rights reserved.
  7.  
  8. if "%1" == "/H" goto showhelp
  9. if "%1" == "/h" goto showhelp
  10. if "%1" == "/?" goto showhelp
  11. if "%1" == "" goto showhelp
  12.  
  13. set SYSDRV=0123456789012345678901234567890123456789
  14. if not "%SYSDRV%" == "0123456789012345678901234567890123456789" goto error2
  15. set SYSDRV=
  16.  
  17. if "%1"=="a:" set SYSDRV=A:
  18. if "%1"=="A:" set SYSDRV=A:
  19. if "%1"=="b:" set SYSDRV=B:
  20. if "%1"=="B:" set SYSDRV=B:
  21. if "%1"=="c:" set SYSDRV=C:
  22. if "%1"=="C:" set SYSDRV=C:
  23. if "%1"=="d:" set SYSDRV=D:
  24. if "%1"=="D:" set SYSDRV=D:
  25. if "%1"=="e:" set SYSDRV=E:
  26. if "%1"=="E:" set SYSDRV=E:
  27. if "%1"=="f:" set SYSDRV=F:
  28. if "%1"=="F:" set SYSDRV=F:
  29. if "%1"=="g:" set SYSDRV=G:
  30. if "%1"=="G:" set SYSDRV=G:
  31. if "%1"=="h:" set SYSDRV=H:
  32. if "%1"=="H:" set SYSDRV=H:
  33. if "%1"=="i:" set SYSDRV=I:
  34. if "%1"=="I:" set SYSDRV=I:
  35. if "%1"=="j:" set SYSDRV=J:
  36. if "%1"=="J:" set SYSDRV=J:
  37. if "%1"=="k:" set SYSDRV=K:
  38. if "%1"=="K:" set SYSDRV=K:
  39. if "%1"=="l:" set SYSDRV=L:
  40. if "%1"=="L:" set SYSDRV=L:
  41. if "%1"=="m:" set SYSDRV=M:
  42. if "%1"=="M:" set SYSDRV=M:
  43. if "%1"=="n:" set SYSDRV=N:
  44. if "%1"=="N:" set SYSDRV=N:
  45. if "%1"=="o:" set SYSDRV=O:
  46. if "%1"=="O:" set SYSDRV=O:
  47. if "%1"=="p:" set SYSDRV=P:
  48. if "%1"=="P:" set SYSDRV=P:
  49. if "%1"=="q:" set SYSDRV=Q:
  50. if "%1"=="Q:" set SYSDRV=Q:
  51. if "%1"=="r:" set SYSDRV=R:
  52. if "%1"=="R:" set SYSDRV=R:
  53. if "%1"=="s:" set SYSDRV=S:
  54. if "%1"=="S:" set SYSDRV=S:
  55. if "%1"=="t:" set SYSDRV=T:
  56. if "%1"=="T:" set SYSDRV=T:
  57. if "%1"=="u:" set SYSDRV=U:
  58. if "%1"=="U:" set SYSDRV=U:
  59. if "%1"=="v:" set SYSDRV=V:
  60. if "%1"=="V:" set SYSDRV=V:
  61. if "%1"=="w:" set SYSDRV=W:
  62. if "%1"=="W:" set SYSDRV=W:
  63. if "%1"=="x:" set SYSDRV=X:
  64. if "%1"=="X:" set SYSDRV=X:
  65. if "%1"=="y:" set SYSDRV=Y:
  66. if "%1"=="Y:" set SYSDRV=Y:
  67. if "%1"=="z:" set SYSDRV=Z:
  68. if "%1"=="Z:" set SYSDRV=Z:
  69.  
  70. if "%SYSDRV%" == "" goto error3
  71. set SWCH=/r
  72.  
  73. if "%SYSDRV%" == "A:" goto floppy
  74. if "%SYSDRV%" == "B:" goto floppy
  75.  
  76. set SYSDIR=DRDOS
  77. goto hard
  78.  
  79. :floppy
  80. echo  
  81. echo Updating files for a floppy based system on drive %SYSDRV%
  82. echo  
  83.  
  84. :loop0
  85. set DISKNAME=STARTUP
  86. set IDFILE=command.com
  87. gosub insert_disk
  88. gosub update_files
  89. if exist %SYSDRV%\install.exe copy util\setup.exe %SYSDRV%\install.exe >NUL
  90.  
  91. set DSKTYPE=360
  92. if exist %SYSDRV%\emm386.sys set DSKTYPE=720
  93. if exist %SYSDRV%\lock.exe   set DSKTYPE=1.2/1.44
  94.  
  95. if "%DSKTYPE%" == "1.2/1.44" goto vmax_disk
  96.  
  97. set DISKNAME=UTILITITES-1
  98. set IDFILE=emm386.sys
  99. if "%DSKTYPE%" == "720" set IDFILE=editor.exe
  100. gosub insert_disk
  101. gosub update_files
  102. if exist %SYSDRV%\install.exe copy util\setup.exe %SYSDRV%\install.exe >NUL
  103.  
  104. set DISKNAME=UTILITITES-2
  105. set IDFILE=mem.exe
  106. if "%DSKTYPE%" == "720" set IDFILE=sstor.exe
  107. gosub insert_disk
  108. gosub update_files
  109.  
  110. if "%DSKTYPE%" == "720" goto vmax_disk
  111.  
  112. set DISKNAME=UTILITITES-3
  113. set IDFILE=lock.exe
  114. gosub insert_disk
  115. gosub update_files
  116.  
  117. set DISKNAME=UTILITITES-4
  118. set IDFILE=print.com
  119. gosub insert_disk
  120. gosub update_files
  121.  
  122. set DISKNAME=UTILITITES-5
  123. set IDFILE=recover.com
  124. gosub insert_disk
  125. gosub update_files
  126.  
  127. :vmax_disk
  128. set DISKNAME=VIEWMAX
  129. set IDFILE=viewmax.exe
  130. gosub insert_disk
  131. gosub update_files
  132.  
  133. :floppyend
  134. if not exist update.1 goto success
  135. gosub swap_disk
  136. goto loop0
  137.  
  138. :hard
  139. if "%2" == "" goto skip1
  140. if "%2" == "/S" goto repall
  141. if "%2" == "/s" goto repall
  142. set SYSDIR=%2
  143. if "%SYSDIR%" == "\" set SYSDIR=.
  144.  
  145. :skip3
  146. if "%3" == "/S" goto repall
  147. if "%3" == "/s" goto repall
  148. goto skip1
  149.  
  150. :repall
  151. set SWCH=/r /s
  152. set SYSDIR=.
  153. echo  
  154. echo WARNING: You have specified to update all copies of the relevant files
  155. echo on drive %SYSDRV%. UPDATE will NOT check if the files are DR DOS files.
  156. goto skip2
  157.  
  158. :skip1
  159. echo  
  160. if "%SYSDIR%" == "." echo Updating DR DOS files on drive %SYSDRV%
  161. if not "%SYSDIR%" == "." echo Updating DR DOS files in directory %SYSDIR% on drive %SYSDRV%
  162. :skip2
  163. echo  
  164. echo Press CTRL-C now if this is not correct and enter UPDATE /H for more
  165. echo information.
  166. echo  
  167. pause
  168.  
  169. if "%SYSDIR%" == "." goto skiptest
  170. if not exist %SYSDRV%\%SYSDIR%\hidos.sys goto error
  171. :skiptest
  172.  
  173. rem ** determine if there's a swapped sstor drive
  174. rem ** this will result in SET SWAPDRV=NONE or SET SWAPDRV=d:
  175. sstorchk
  176.  
  177. :loop1
  178. echo Updating files...
  179. replace @util.fl %SYSDRV%\%SYSDIR% %SWCH% >NUL
  180. replace @sys.fl  %SYSDRV%\ /r /h >NUL
  181. if not exist sys\command.com goto skip_cmd
  182. if not exist %COMSPEC% goto skip_cmd
  183. copy sys\command.com %COMSPEC% >nul
  184. :skip_cmd
  185.  
  186. if "%SWAPDRV%" == "NONE" goto almost
  187. replace @util.fl %SWAPDRV%\%SYSDIR% %SWCH% >NUL
  188. replace @sys.fl  %SWAPDRV%\ /r /h >NUL
  189.  
  190. :almost
  191. if not exist update.1 goto success
  192. gosub swap_disk
  193. goto loop1
  194.  
  195. :success
  196. echo  
  197. echo UPDATE completed successfully.
  198. goto exit
  199.  
  200. :insert_disk
  201. echo Insert either your master %DISKNAME% disk or your
  202. echo working %DISKNAME% disk in drive %SYSDRV%
  203. echo If it is the master disk ensure the physical write protection is removed.
  204. echo  
  205. pause
  206. if exist %SYSDRV%\%IDFILE% return
  207. echo ERROR: Wrong disk in drive %SYSDRV%
  208. echo  
  209. goto insert_disk
  210.  
  211.  
  212. :update_files
  213. echo Updating files...
  214. replace @util.fl %SYSDRV% /r >NUL
  215. replace @sys.fl %SYSDRV% /r /h >NUL
  216. echo  
  217. return
  218.  
  219. :swap_disk
  220. echo Insert Update Disk #2
  221. echo  
  222. pause
  223. if exist update.2 return
  224. echo ERROR: Wrong Update Disk in drive %SYSDRV%
  225. echo  
  226. goto swap_disk
  227.  
  228.  
  229. :update_files
  230. :error
  231. echo  
  232. echo ERROR:  The drive/directory specified does not contain DR DOS files.
  233. echo  
  234. goto exit
  235.  
  236. :error2
  237. echo  
  238. echo ERROR:  There is insufficient environment space to run this batch file.
  239. echo         Increase the environment space and try again.
  240. echo  
  241. goto exit
  242.  
  243. :error3
  244. echo  
  245. echo ERROR:  Invalid drive specifier. Enter UPDATE /H for more information.
  246. echo  
  247. goto exit
  248.  
  249. :error4
  250. echo  
  251. echo ERROR:  Incompatible operating system. Update requires DR DOS 6.0.
  252. echo  
  253. goto exit
  254.  
  255. :showhelp
  256. echo  
  257. echo UPDATE will replace DR DOS files on your hard disk or floppy disks with the
  258. echo updated versions contained on this floppy disk.
  259. echo  
  260. echo UPDATE d: [directory] [/S]
  261. echo  
  262. echo d:         Drive to update. (A: B: or C:)
  263. echo directory  Directory where DR DOS files are located.
  264. echo /S         Update all copies of the relevant files on the hard disk specified.
  265. echo            WARNING: This option DOES NOT check that the files being updated
  266. echo            are DR DOS files.
  267. echo  
  268. echo For example UPDATE C: OSFILES will cause the files in the directory C:\OSFILES
  269. echo to be updated.
  270. echo  
  271. echo If you specify a floppy drive UPDATE will prompt you for each disk as it is
  272. echo required. The disks can be either the master disks or your working disks if
  273. echo if you have a twin drive floppy based system.
  274. echo   
  275.  
  276. :exit
  277. rem set SYSDRV=
  278. rem set SYSDIR=
  279. rem set SET720=
  280. rem set SWCH=
  281. rem set SWAPDRV=
  282. rem set DISKNAME=
  283. rem set IDFILE=
  284. rem set DSKTYPE=
  285.